< previous page page_317 next page >

Page 317
A command-line utility included with the Internet Client SDK, SIGNCODE, allows you to sign your files. When you compile your ActiveX control into an OCX file, it is given a global unique identifier, or GUID. This identifier is necessary to add the control to a Web page. To determine this GUID, you can look at the sample HTM file generated by the Package and Deployment Wizard. For an example use of the <OBJECT> tag, see Appendix B. After you determine the GUID, use it to embed the control in your Web page.
sarrow.gifSee "Files Created for the Internet," p. 790
The final step is to place the CAB and HTML files on the Web server. Make sure that the previously mentioned <OBJECT> tag contains the name of the CAB file, as described in Appendix C.
After all the files are in place, other users should be able to use your control on their machines. To verify that the page works, try hitting your Web page on a machine that does not have your control installed. If the control fails to load, check the following:
From the Security tab in the Internet Explorer Internet Options dialog box (accessed from the View menu), add your Web server to the trusted sites zone. Restart the browser and reload the page.
Install and register the ActiveX control with a standard setup program. This way, you can verify that the problem is in the CAB file.
While troubleshooting control problems in Internet Explorer, you may want to delete the cached files and objects so that you get a "fresh" copy when you reload the page. You can delete the temporary files by clicking the Delete Files button on the General tab of the Internet Options dialog box. You then can remove your ActiveX control by selecting it in the \Windows\Downloaded Program Files directory and choosing File, Remove Program File.
Enhancing an ActiveX Control
The preceding section introduced the concepts involved in creating an ActiveX control by arranging existing controls on a UserControl object. However, you can also create "new" controls simply by adding capabilities to an existing control. This means that you are working with a single base control but adding properties, methods, and events to provide additional capabilities to the user. For example, you might want to create a special scrollbar control that uses letters instead of numbers or a text box that accepts only certain characters.
Placing the code that performs these tasks into a separate ActiveX control makes it easier to use the code in future programs. For example, rather than add special code to every TextBox control in your program, you can simply use your "enhanced" control in place of the text box. To create these enhanced controls, you use many of the same techniques that you learned in the previous sections:
1. Start a new ActiveX control project.
2. Add the base control to the UserControl window.
3. Add code for properties, methods, and events.

 
< previous page page_317 next page >